<?php
/**
 * | ---------------------------------------------------------------------------------------------------
 * | ProjectName: mvc
 * | ---------------------------------------------------------------------------------------------------
 * | Author：johnxu <fsyzxz@163.com>
 * | ---------------------------------------------------------------------------------------------------
 * | Home: https://www.xfjpeter.cn
 * | ---------------------------------------------------------------------------------------------------
 * | Data: 201907202019-07-20
 * | ---------------------------------------------------------------------------------------------------
 * | Desc:
 * | ---------------------------------------------------------------------------------------------------
 */

namespace app\common\validate;

use think\Validate;

class Rule extends Validate
{
    protected $rule = [
        'title'   => 'require',
        'method'  => 'require|in:get,post,delete',
        'is_menu' => 'require|in:0,1',
        'status'  => 'require|in:0,1',
    ];

    protected $message = [
        'title.require'   => '请输入规则名称',
        'method.require'  => '请选择请求方式',
        'method.in'       => '请求方式只能是：get|post|delete',
        'is_menu.require' => '请选择是否菜单',
        'is_menu.in'      => '选择菜单方式错误',
        'status.require'  => '请选择状态',
        'status.in'       => '选择状态方式错误',
    ];

    protected $scene = [
        'add' => ['title', 'method', 'is_menu', 'status'],
    ];
}